package com.hex.ds.hdrs.common.constant;

import org.terracotta.statistics.Statistic;

/**
 * @author lwz
 * @date 2020-12-29
 * @des
 */
public class Const {
    public static final String UNPUBLISHED = "0";
    public static final String EABLE = "1";
    public static final String UNENABLE = "2";

    public static final String JOB_CLOSE_VAILID_DATE = "2";
    public static final String JOB_OPEN_VAILID_DATE = "1";

    public static final String CRON_TASK_SUCCESS = "1"; //定时任务执行成功
    public static final String CRON_TASK_FAIL = "2"; //定时任务执行失败
    public static final String CRON_TASK_RUNNING = "3"; //定时任务执行中
    public static final String CRON_TASK_TODO_RUN = "4"; //定时任务待执行

    public static final String AGENT_HA_STATUS_STOP = "stop";
    public static final String AGENT_HA_STATUS_NORMAL = "normal";
    public static final String AGENT_HA_STATUS_WARN = "warn";
    public static final String AGENT_HA_STATUS_ERROR = "error";

    public static final String AGENT_DEFAULT_STATUS = "0";
    public static final String AGENT_ENABLE_STATUS = "1";
    public static final String AGENT_STOP_STATUS = "2";
    public static final String AGENT_INSTALL_FAIL_STATUS = "3";

    public static final String TASK_TODO_RUN = "1";                  //周期任务待执行
    public static final String TASK_RUNNING = "2";                  //周期任务执行中
    public static final String TASK_STOP = "3";                     //周期任务暂停
    public static final String TASK_SUCCESS = "4";                  //周期任务执行成功
    public static final String TASK_FAIL = "5";                     //周期任务执行失败
    public static final String TASK_HAND_SUCCESS = "6";             //周期任务置虚

    public static final String JOB_TO_DO = "1";             //作业未完成
    public static final String JOB_DO_SUCCESS = "4";        //作业完成


    public static final String SYS_CONFIG_LABEL = "默认工作日";
    public static final String SYS_CONFIG_SIGN = "default_work_day";

    public static final String BAT_JOB_TASK_NAME = "跑批";

    public static final String IS_USER = "2";
    public static final String IS_AGENT = "1";
    public static final String IS_CYCLE_TASK = "8";
    public static final String IS_CRON_TASK = "9";

    public static final String WARN_LEVEL_INFO = "info";             //提醒等级 info
    public static final String WARN_LEVEL_WARN = "warn";             //提醒等级 warn
    public static final String WARN_LEVEL_ERROR = "error";           //提醒等级 error

    public static final String TYPE_AGENT = "agent";             //类型 节点
    public static final String TYPE_CENTER = "center";           //类型 中心
    public static final String TYPE_APP = "app";                 //类型 应用

    public static final String WARN_RULE_NORMAL = "1";            //告警规则类型 正常
    public static final String WARN_RULE_WARNNING = "2";            //告警规则类型 提醒
    public static final String WARN_RULE_ERROR = "3";            //告警规则类型 错误

    public static final String WARN_LEVEL_NORMAL = "1";            //告警水平类型 一般
    public static final String WARN_LEVEL_WARNNING = "2";            //告警水平类型 告警
    public static final String WARN_LEVEL_SERIOUS = "3";            //告警水平类型 严重

    public static final String WARN_IS_REGION_ALL = "1";            //指定所有节点告警
    public static final String WARN_REGION_JSON = "2";            //自定义节点告警

    public static final String WARN_NOT_SEND = "0";    //未发送
    public static final String WARN_HAS_SEND = "1";    //已发送
    public static final String WARN_NOT_NEED_SEND = "2"; //不需要发送

    public static final String QUEUE_CENTER_APP_CODE = "A000000"; //队列信息中队列总量所对应的APPCode
    public static final String QUEUE_INF_TO_DO = "0";   //待执行队列
    public static final String QUEUE_INF_TO_RUN = "1";  //可执行队列
    public static final String QUEUE_INF_RUNNING = "2"; //正在执行队列

    public static final String AGENT_WARN_OFF_LINE = "AGENT_OFF";
    public static final String AGENT_WARN_OFF_LINE_NAME = "AGENT服务掉线预警";
    public static final String AGENT_WARN_ON_LINE = "AGENT_ON";
    public static final String AGENT_WARN_ON_LINE_NAME = "AGENT服务上线通知";
    public static final String AGENT_WARN_CPU = "AGENT_CPU";      //Agent CPU预警
    public static final String AGENT_WARN_CPU_NAME = "节点CPU预警";
    public static final String AGENT_WARN_RAM = "AGENT_RAM";
    public static final String AGENT_WARN_RAM_NAME = "节点内存预警";
    public static final String AGENT_WARN_IO = "12";
    public static final String AGENT_WARN_IO_NAME = "Agent IO预警";
    public static final String AGENT_WARN_DISK = "AGENT_DISK";
    public static final String AGENT_WARN_DISK_NAME = "节点磁盘容量预警";
    public static final String AGENT_CLIENT_CHANGE = "AGENT_ALL";
    public static final String AGENT_CLIENT_CHANGE_NAME = "AGENT服务上/下线汇总通知";
    public static final String CENTER_MASTER_SWITCH = "MASTER_SWITCH";
    public static final String CENTER_MASTER_SWITCH_NAME = "中心切换通知";
    public static final String RAM_QUEUE_WARN = "RAM_QUEUE";
    public static final String RAM_QUEUE_WARN_NAME = "内存队列数据量过大预警";
    public static final String DB_TASK_WARN = "DB_TASK";
    public static final String DB_TASK_WARN_NAME = "任务实例数据量过大预警";

    public static final String TASK_RUN_END_NOTIC = "TASK_END";
    public static final String TASK_RUN_END_NOTIC_NAME = "指定任务执行结果通知";
    public static final String TASK_TIMING_SUMMARY = "TASK_RESULT";
    public static final String TASK_TIMING_SUMMARY_NAME = "定期发送任务执行结果通知";
    public static final String TASK_APPOINT_TIME_NO_FINISH = "TASK_TIMER_NO";
    public static final String TASK_APPOINT_TIME_NO_FINISH_NAME = "指定任务指定时间未完成预警";
    public static final String TASK_FAIL_OUT = "TASK_FAIL";
    public static final String TASK_FAIL_OUT_NAME = "今日任务失败数过多预警";
    public static final String TASK_RUNNING_TIME_OUT = "TASK_OVERTIME_NO";
    public static final String TASK_RUNNING_TIME_OUT_NAME = "指定任务超时未完成预警";
    public static final String TASK_NO_FINISH_OUT = "TASK_COUNT_NO";
    public static final String TASK_NO_FINISH_OUT_NAME = "定时统计任务未完成数量预警";
    public static final String FAIL_TASK_NO_HANDLE_TIME_OUT = "TASK_ERROR";
    public static final String FAIL_TASK_NO_HANDLE_TIME_OUT_NAME = "任务异常超时未处理预警";


    public static final String CYCLE_JOB_IS_WORD_DAY_RUN_YES = "1";
    public static final String CYCLE_JOB_IS_WORD_DAY_RUN_NO = "0";

    public static final String MUTEX_POOL_TYPE_SYS = "1";
    public static final String MUTEX_POOL_TYPE_APP = "2";

    public static final String MAIL_NOT_SEND = "0";
    public static final String MAIL_SEND_SUCCESS = "1";
    public static final String MAIL_SEND_FAIL = "2";

    public static final String MAIL_NOTICE_OPEN = "1";
    public static final String MAIL_NOTICE_CLOSE = "2";


    public static final String SMS_NOT_SEND = "0";
    public static final String SMS_SEND_SUCCESS = "1";
    public static final String SMS_SEND_FAIL = "2";

    public static final String SMS_NOTICE_OPEN = "1";
    public static final String SMS_NOTICE_CLOSE = "2";

    public static final String MAIL_IS_HTML = "1";
    public static final String MAIL_IS_TXT = "0";

    public static final String DEV_ADMINS_TYPE = "1";            //运维管理员
    public static final String MONITOR_ADMINS_TYPE = "2";        //监控管理员
    public static final String RELEASE_ADMINS_TYPE = "3";        //发布管理员

    public static final String APP_ADMINS_ROLE_ID = "104";
    public static final String DEV_ADMINS_ROLE_ID = "109";              //运维管理员
    public static final String MONITOR_ADMINS_ROLE_ID = "110";        //监控管理员
    public static final String RELEASE_ADMINS_ROLE_ID = "111";        //发布管理员

    public static final String INIT_LOADER_MARK = "init_loader";                  //加载器 初始化
    public static final String ALL_LOADER_MARK = "all_loader";                    //加载器 全量
    public static final String ADD_LOADER_MARK = "add_loader";                    //加载器 增量
    public static final String FREE_LOADER_MARK = "free_loader";                  //加载器 空闲
    public static final String STOP_LOADER_MARK = "stop_loader";                  //加载器 暂停

    public static final String INIT_LST_FNS_MARK = "init_lstFns";                  //最新完成作业/任务 初始化
    public static final String ALL_LST_FNS_MARK = "all_lstFns";                    //最新完成作业/任务 全量
    public static final String ADD_LST_FNS_MARK = "add_lstFns";                    //最新完成作业/任务 增量
    public static final String FREE_LST_FNS_MARK = "free_lstFns";                  //最新完成作业/任务 空闲
    public static final String STOP_LST_FNS_MARK = "stop_lstFns";                  //最新完成作业/任务 暂停

    public static final String INIT_DEF_MARK = "init_def";                  //作业/任务定义 初始化
    public static final String ALL_DEF_MARK = "all_def";                    //作业/任务定义 全量
    public static final String FREE_DEF_MARK = "free_def";                  //作业/任务定义 空闲
    public static final String STOP_DEF_MARK = "stop_def";                  //作业/任务定义 暂停

    public static final String CENTER_SLEEP = "sleep";             //中心休眠
    public static final String CENTER_RUN = "run";                 //中心正常运行
    public static final String CENTER_STARTING = "starting";       //中心启动中
    public static final String CENTER_STOPPING = "stopping";       //中心消亡中

    //cron 定时任务执行完成状态
    public static final String DOING_CRON = "3";                    //执行中
    public static final String SUCCESS_CRON = "1";                  //执行成功
    public static final String FAIL_CRON = "2";                     //执行失败

    public static final String JOB_IN_TO_DO = "to_do";                    //作业所在队列--待处理
    public static final String JOB_IN_TO_RUN = "to_run";                  //作业所在队列--可执行
    public static final String JOB_IN_RUNNING = "running";                //作业所在队列--执行中

    public static final String AGENT_STATUS_START = "1";                 //节点启动
    public static final String AGENT_STATUS_STOP = "2";                  //节点停用

    public static final String APP_STATUS_START = "0";                 //应用启动
    public static final String APP_STATUS_STOP = "1";                  //应用停用

    public static final String IS_MASTER = "0";                   //master中心
    public static final String NOT_MASTER = "1";                  //不是master

    public static final String GROUP_APP_RES = "1";                     //按照活动的应用的资源数
    public static final String GROUP_APP_CONCURRENT = "2";              //按照活动的应用的并发数
    public static final String GROUP_APP_STRATEGY_RES = "3";            //按照活动的应用的策略时间段内的资源数
    public static final String GROUP_APP_STRATEGY_CONCURRENT = "4";     //按照活动的应用的策略时间段内的并发数

    public static final String SORT_PRIORITY = "1";                     //按优先级顺序又大到小
    public static final String SORT_PRIORITY_RES_DESC = "2";            //按优先级且资源数顺序,资源数由大到小
    public static final String SORT_PRIORITY_RES_ASC = "3";             //按优先级且资源数顺序,资源数由小到大
    public static final String SORT_DOWN_DEPEND_NUM = "4";              //下游依赖数总数  大的先做
    public static final String SORT_NEXT_DOWN_DEPEND_NUM = "5";         //按下一级依赖数量  大的先做
    public static final String SORT_EARLIER_TS = "6";                   //按时间最早先执行
    public static final String SORT_DOWN_DEPEND_RES = "7";              //下游依赖使用资源数总数  大的先做
    public static final String SORT_NEXT_DOWN_DEPEND_RES = "8";         //下一级依赖使用资源数总数  大的先做

    public static final String RES_NOT_ENOUGH_BACK_FIRST = "back_first";    //分发时资源不足  任务添加回队首
    public static final String RES_NOT_ENOUGH_DOWN_SORT = "down_sort";      //分发时资源不足  任务需要降序
    public static final String RES_NOT_ENOUGH_DELAY_TS = "delay_ts";        //分发时资源不足  需要等待时间
    public static final String SEND_FAIL_BACK_FIRST = "back_first";         //发送失败  任务添加回队首
    public static final String SEND_FAIL_DELAY_TS = "delay_ts";             //发送失败  需要等待时间

    public static final String TASK_UP_SORT = "up";           //任务升序
    public static final String TASK_DOWN_SORT = "down";       //任务降序

    public static final String IS_TO_SYS = "true";   //发送通知给系统管理员
    public static final String IS_TO_APP = "true";   //发送通知给应用管理员
    public static final String IS_TO_DEP = "true";   //发送通知给运维管理员
    public static final String IS_TO_MON = "true";   //发送通知给监控管理员

    public static final String TRACK_TYPE_INIT_TO_DO = "init_to_do";                //初始化toDo
    public static final String TRACK_TYPE_ADD_TO_DO = "add_to_do";                  //增量toDo
    public static final String TRACK_TYPE_ALL_TO_DO = "all_to_do";                  //全量toDo
    public static final String TRACK_TYPE_DELTA_TO_DO = "delta_to_do";              //delta返回toDo
    public static final String TRACK_TYPE_RUN_TO_DO = "run_to_do";                  //toRun返回toDo
    public static final String TRACK_TYPE_RUNNING_TO_DO = "running_to_do";          //running返回toDo
    public static final String TRACK_TYPE_WEB_RUN_TO_DO = "web_run_to_do";          //界面toRun到toDo
    public static final String TRACK_TYPE_TOUCH_TO_DO = "touch_to_do";              //触发任务到toDo
    public static final String TRACK_TYPE_DO_TO_RUN = "do_to_run";                  //toDo到toRun
    public static final String TRACK_TYPE_TOUCH_TO_RUN = "touch_to_run";            //触发任务到toRun
    public static final String TRACK_TYPE_WEB_TO_RUN = "web_to_run";                //界面立即执行到toRun
    public static final String TRACK_TYPE_RUN_TO_RUNNING = "run_to_running";        //toRun到running
    public static final String TRACK_TYPE_WEB_TO_RUNNING = "web_to_Running";        //界面立即执行到running
    public static final String TRACK_TYPE_RUNNING_TO_RUN = "running_to_run";        //running到toRun

    public static final String LABEL_FAIL = "所属标签下的作业上个业务日期还没全完成";        //


    public static final String CRON_TASK_STATUS_UNPUBLISHED = "0";      //定时任务状态未发布
    public static final String CRON_TASK_STATUS_START = "1";      //定时任务状态启用
    public static final String CRON_TASK_STATUS_STOP = "2";      //定时任务状态未停用

    public static final String IS_VALID_DATE = "1";   //限定作业生效日期范围
    public static final String NO_VALID_DATE = "2";   //不限定作业生效日期范围

    public static final String CRON_TASK_EXEC_STATUS_SUCCESS = "1";   //定时任务执行状态执行成功
    public static final String CRON_TASK_EXEC_STATUS_FAIL = "2";   //定时任务执行状态执行失败
    public static final String CRON_TASK_EXEC_STATUS_EXECING = "3";   //定时任务执行状态执行中

    public static final String MAIL_LINE_FEED = "\r\n";   //换行符 换单行
    public static final String MAIL_LINE_FEED_DOUBLE = "\n\n";  //换两行

    public static final String KILL = "kill";                  //kill task
    public static final String WARN = "warn";                  //不处理 预警

    //监控agent的running是否存在对应的任务
    public static final String EXIST = "exist";
    public static final String NOT_EXIST = "notExist";

    public static final String APP_ADMIN = "admin";

    //节点360对应的选择时间
    public static final String CHANGE_DATE_HALF_DAY = "12";   //选择12小时
    public static final String CHANGE_DATE_ONE_DAY = "24";   //选择一天
    public static final String CHANGE_DATE_SEVEN_DAY = "168";   //选择七天

    public static final Integer HALF_DAY_STEPS = 5;
    public static final Integer ONE_DAY_STEPS = 10;
    public static final Integer SEVEN_DAY_STEPS = 120;

    public static final String CPUTIME_CEVTER_NUMBER = "12";

    public static final String FILE_XLS = "XLS";
    public static final String FILE_XLSX = "XLSX";

    public static final String NOT_SINGLE_JOB = "0";       // 不是单次作业
    public static final String IS_SINGLE_JOB = "1";        // 单次作业
    public static final String NOT_SINGLE_JOB_CN = "否";   // 不是单次作业
    public static final String IS_SINGLE_JOB_CN = "是";    // 单次作业

    public static final String JOB_DEF_UPLOAD_ADD_OPERATOR = "新增";
    public static final String JOB_DEF_UPLOAD_UP_OPERATOR = "更新";
    public static final String JOB_DEF_UPLOAD_DEL_OPERATOR = "删除";

    public static final String TASK_EXEC_SUCCESS = "0";     //任务执行成功
    public static final String TASK_EXEC_BIZ_FAIL = "99";   //任务执行业务性失败
    public static final String TASK_EXEC_FAIL = "1";        //任务执行业务性失败
    public static final String TASK_EXEC_KILL = "137";     //任务杀掉

    //数据备份类型
    public static final String CYCLE = "cycle";       // 周期作业
    public static final String CRON = "cron";        // 定时任务
    public static final String HEARTBEAT_LOG = "heartbeatLog";   // 心跳日志
    public static final String RUNNING_LOG = "runningLog";    // 运行状况日志
    public static final String SERVER_LOG = "serverLog";    // 服务器交互日志
    public static final String MAIL_SEND_LOG = "mailSendLog";    // 邮件发送日志

    //http状态码
    public static final String HTTP_OK = "200";    // 成功
    public static final String HTTP_FAIL = "417";  // 异常失败

    //重新计算资源 打标状态
    public static final String APP_MARK_RUN = "appRun";        //AppSession重新计算资源中
    public static final String APP_MARK_STOP = "appStop";      //AppSession不在重新计算资源中
    public static final String AGENT_MARK_RUN = "agentRun";    //AgentSession重新计算资源中
    public static final String AGENT_MARK_STOP = "agentStop";  //AgentSession不在重新计算资源中


    public static final String AGENT_NAME = "hdrs-agent";
    public static final String AGENT_INSTALL = "install";

    //上游依赖还是下游依赖
    public static final String DEPEND_TYPE_UP = "up";
    public static final String DEPEND_TYPE_DOWN = "down";

    //告警发送状态
    public static final String WARN_SEND_STATUS_NO = "NSEND";
    public static final String WARN_SEND_STATUS_SUCCESS = "SUCCESS";
    public static final String WARN_SEND_STATUS_ERROR = "ERROR";

    //告警方式
    public static final String WARN_TYPE_MAIL = "MAIL";
    public static final String WARN_TYPE_MES = "MES";
    public static final String WARN_TYPE_WECHAT = "WECHAT";

    //系统管理员预警类型
    public static final String WARN_SYS_TYPE_DOWN = "1";//Agent掉线
    public static final String WARN_SYS_TYPE_UP = "2";//Agent上线
    public static final String WARN_SYS_TYPE_CPU = "3";//CPU预警
    public static final String WARN_SYS_TYPE_DISK = "13";//磁盘预警
    public static final String WARN_SYS_TYPE_MEM = "11";//内存预警
    public static final String WARN_SYS_TYPE_IO = "12";//IO预警
    public static final String WARN_SYS_TYPE_UP_DOWN = "4";//上下线预警汇总
    public static final String WARN_SYS_TYPE_MASTER = "5";//Master节点切换
    public static final String WARN_SYS_TYPE_MEM_MAX = "6";//内存队列过大预警
    public static final String WARN_SYS_TYPE_DB_MAX = "7";//DB实例数据过多预警

    //作业定义日期表达式
    public static final String JOB_DEF_DATE_EXPRESSION_DAY = "D";
    public static final String JOB_DEF_DATE_EXPRESSION_DAY_CN = "日";
    public static final String JOB_DEF_DATE_EXPRESSION_WEEK_CN = "周";
    public static final String JOB_DEF_DATE_EXPRESSION_WEEK = "W";
    public static final String JOB_DEF_DATE_EXPRESSION_MONTH_CN = "月";
    public static final String JOB_DEF_DATE_EXPRESSION_MONTH = "M";
    public static final String JOB_DEF_DATE_EXPRESSION_QUARTER_CN = "季";
    public static final String JOB_DEF_DATE_EXPRESSION_QUARTER = "Q";
    public static final String JOB_DEF_DATE_EXPRESSION_YEAR_CN = "年";
    public static final String JOB_DEF_DATE_EXPRESSION_YEAR = "Y";
    public static final String JOB_DEF_DATE_EXPRESSION_OTHER_CN = "自定义";
    public static final String JOB_DEF_DATE_EXPRESSION_OTHER = "O";
    public static final String JOB_DEF_DATE_EXPRESSION_XUN_CN = "旬";
    public static final String JOB_DEF_DATE_EXPRESSION_XUN = "X";

    public static final String TASK_TYPE_PERIOD = "PERIOD";
    public static final String TASK_TYPE_CRON = "CRON";

    public static final String TASK_COUNT_IS_HIS = "1";
    public static final String TASK_COUNT_NOT_HIS = "0";

    //作业实例 作业状态 1:完成 2:未完成
    public static final String PERIOD_JOB_STATUS_S = "1";
    public static final String PERIOD_JOB_STATUS_E = "2";

    public static final String PERIOD_JOB_STATUS_TODO = "1";//待处理
    public static final String PERIOD_JOB_STATUS_RUN = "2";//处理中
    public static final String PERIOD_JOB_STATUS_STOP = "3";//暂停中
    public static final String PERIOD_JOB_STATUS_SUCCESS = "4";//处理完成
    public static final String PERIOD_JOB_STATUS_ERROR = "5";//处理失败

    //周期任务实例状态
    public static final String PERIOD_TASK_STATUS_TODO = "1";//待处理
    public static final String PERIOD_TASK_STATUS_RUN = "2";//处理中
    public static final String PERIOD_TASK_STATUS_SUCCESS = "4";//处理完成
    public static final String PERIOD_TASK_STATUS_ERROR = "5";//处理失败
    public static final String PERIOD_TASK_STATUS_ZX = "6";//置虚
}
